﻿@model Rated.Website.Models.LocalPasswordModel
@{
    ViewBag.Title = "Manage Account";
    var userProfile = Rated.Website.Helpers.UserHelper.UserProfile;
    
    
}
<div class="clearfix contentSection contentSection_bottom">
    <hgroup class="title">
    <h1>@ViewBag.Title</h1>
</hgroup>
    <p class="message-success">@ViewBag.StatusMessage</p>
    <p style="margin-bottom: 20px;">
        You're logged in as <strong>@User.Identity.Name</strong>.</p>
    <div id="tabs" class="tabs">
        <ul>
            <li><a href="#myDetails">My Details</a></li>
            <li><a href="#myListings">My Listings</a></li>
            <li><a href="#myReviews">My Reviews</a></li>
        </ul>
        <div id="myDetails">
            <div class="clearfix form">
                <form method="post" id="updateUserProfile" action="@Url.Action("Update", "UserProfile")">
                <fieldset>
                    <ol>
                        <li class="clearfix">
                            <label>
                                Title</label>
                            @Html.TextBoxFor(o => userProfile.Title)
                        </li>
                        <li class="clearfix">
                            <label>
                                First Name</label>
                            @Html.TextBoxFor(o => userProfile.FirstName)
                        </li>
                        <li class="clearfix">
                            <label>
                                Last Name</label>
                            @Html.TextBoxFor(o => userProfile.LastName)
                        </li>
                    </ol>
                    <button id="btnUpdateUserProfile" class="cta clearfix">
                        Update</button>
                </fieldset>
                </form>
            </div>
            <div class="clearfix form">
                @if (ViewBag.HasLocalPassword)
                {
                    @Html.Partial("_ChangePasswordPartial")
                }
                else
                { 
                    @Html.Partial("_SetPasswordPartial")
                }
                <section id="externalLogins">
                @Html.Action("RemoveExternalLogins")
                <h3>Add an external login</h3>
                @Html.Action("ExternalLoginsList", new { ReturnUrl = ViewBag.ReturnUrl })
            </section>
            </div>
            <div>
                Upgrade to a premium membership for only £5 per month and have UNLIMITED listings</div>
        </div>
        <div id="myListings">
                @{Html.RenderPartial("_ratedItemList", new Rated.Website.Models.RatedItemListViewModel((int)Membership.GetUser().ProviderUserKey));}
        </div>
        <div id="myReviews">
            <h2>
                Things I've reviewed</h2>
            <div>
                You have reviewed 36 items so far.</div>
            <div>
                You have has a resonse to 2 of your reviews.</div>
            <div>
                You have 10 new reviews out of 100 in total, and 3 edited reviews.</div>
        </div>
    </div>
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
